Micron Document
🎖️GitЯра🎖️


Displaying Raw • Download

core/network/src/commonMain/kotlin/org/meshtastic/core/network/transport/ConnectionFailures.kt b4bedd92fcc8d65daff79200d71f6ebc3d8f0cfa (b4bedd92) Text, 1.75 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.core.network.transport

Tff7b72import T7ee787kotlinx.io.IOException

T8b949e/**
* Whether this throwable is an ordinary, expected connection failure rather than an application defect.
*
* A radio that is powered off, a hostname that no longer resolves, a broker that closes the socket, or Wi-Fi dropping
* mid-read are all routine for a mesh client: the transport simply retries. Reporting them to crash/error tracking
* buries real defects — an unreachable host accounted for hundreds of "errors" per day with nothing to fix.
*
* Callers should still log these (at warn) so a support session can see them; they just should not be raised as errors.
*/
Tff7b72internal Tff7b72fun Te6edf3ThrowableTb4b4b4.Td2a8ffisExpectedConnectionFailureTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657Boolean Tff7b72= Tff7b72this Tff7b72is Te6edf3IOException Tff7b72|Tff7b72| Te6edf3isPlatformConnectionFailureTb4b4b4(Tb4b4b4)

T8b949e/**
* Platform-specific expected connection failures that do not extend [IOException].
*
* Kept separate so the common predicate above covers the (large) [IOException] family once, on every target.
*/
Tff7b72internal Tff7b72expect Tff7b72fun Te6edf3ThrowableTb4b4b4.Td2a8ffisPlatformConnectionFailureTb4b4b4(Tb4b4b4)Tb4b4b4: Tffa657Boolean

Served by rngit 1.5.0 - Generated in 0.06s